package knowse.app.daos;

import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class LogDAO {
	
	protected static final String TABLE = "Log";
	
	//primary key
	protected static final String LogID = "LogID";
		
	protected static final String json_class = "json_class";
	protected static final String GitRepPath = "GitRepPath";
	protected static final String TimeStamp = "TimeStamp";
	
	public LogDAO(){
		
	}
	
	//insert methods to retrieve and update the database.
	
	
	public void store(LogDataObject tdo){
		ContentValues values= new ContentValues();
		values.put(json_class, tdo.getJsonClass());
		values.put(GitRepPath, tdo.getGitRepoPath());
		values.put(TimeStamp, tdo.getTimeStamp2String());
		SQLiteDatabase db = new DBHelper().getWritableDatabase();
		
		Long bla = db.insert(TABLE, null, values);
		Log.i("LogDAO ", bla.toString());		
		db.close();
	}
}
